﻿function chngmp_showModal(siteurl) {
    var options = {
        url: siteurl + "/_layouts/jeward/chngmp.aspx",
        allowMaximize: false,
        showClose: true,
        width: 600,
        title: "Change Master Page"
    };
    SP.UI.ModalDialog.showModalDialog(options);
}

function chngmp_Change_Click(clientId) {
    document.getElementById(clientId).click();
}

function chngmp_Sync_Click(clientId) {
    document.getElementById(clientId).click();
}

function chngmp_Close_Click() {
    if (window.location.href.indexOf("IsDlg=1") == -1)
        window.location.href("../settings.aspx");
    else
        window.frameElement.commonModalDialogClose(0, 0);
}

var chngmp_notifyId = "";
function chngmp_addNotify(clientId) {
    var chnmp_comeout = document.getElementById(clientId).value;
    chngmp_notifyId = SP.UI.Notify.addNotification(chnmp_comeout, true);
    setTimeout("chngmp_removeNotify()", 2000);
}

function chngmp_removeNotify() {
    SP.UI.Notify.removeNotification(chngmp_notifyId);
    chngmp_notifyId = "";
}